<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <!-- <script src="Promise.js"></script> -->
  <script src="Promise5.js"></script>
</head>

<body>
  <script>

    // let p = new Promise((resolve, reject) => {
    //   setTimeout(() => {
    //     resolve('ok')
    //   });
    // })
    // // console.log(p);
    // p.then().then(v => {
    //   console.log(v); 
    // }
    // ).then(v => {
    //   console.log(v);
    // }
    // ).catch(r=>{
    //   console.log(r);

    // })
    // console.log(res);
    // let res = Promise.reject(new Promise((resolve, reject) => {
    //      resolve('ok')
    // }))
    // console.log(res);
    let p = new Promise((resolve, reject) => {
      resolve('ok')
    })
    let p1 = new Promise((resolve, reject) => {
      throw 'ERROPR'
      // resolve('ok')
    })
    let p2 = new Promise((resolve, reject) => {
      resolve('ok')
    })
  let res = Promise.race([p1,p,p2])
  console.log(res);


  </script>
</body>

</html>